home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 06 - 1990 / 06.03 Mar 90 / TML Tricks / DQtext / DQtext.p next >
Encoding:
Text File  |  1989-11-26  |  1.3 KB  |  55 lines  |  [TEXT/MPS ]

  1. UNIT DQTextProcedure;
  2.  
  3. INTERFACE
  4.  
  5.   USES MemTypes, QuickDraw, OSIntf, ToolIntf, PackIntf, QDaccess;
  6.  
  7. { Tmlpascals QDaccess defines:
  8.  TYPE  QDGlobalsPtr = ^QDGlobalsRec;
  9.     QDGlobalsRec =
  10.       record
  11.         randSeed   :  LongInt;
  12.         screenBits :  BitMap;
  13.         arrow      :  Cursor;
  14.         dkGray     :  Pattern;
  15.         ltGray     :  Pattern;
  16.         gray       :  Pattern;
  17.         black      :  Pattern;
  18.         white      :  Pattern;
  19.         ThePort    :  GrafPtr;
  20.       end;
  21. function QDGlobals: QDGlobalsPtr;external;
  22. }
  23.  
  24.   PROCEDURE DQText(Message: Str255);
  25.  
  26. IMPLEMENTATION
  27.   
  28.   PROCEDURE DQText(Message: Str255);
  29.     
  30.     VAR
  31.       SavedPort    : GrafPtr;
  32.       LocalPort    : GrafPort;
  33.       TheRect      : Rect;
  34.  
  35.     BEGIN
  36.       WITH QDGlobals^ DO
  37.         BEGIN
  38.         GetPort(SavedPort);
  39.         OpenPort(@LocalPort);
  40.         SetPort(@LocalPort);
  41.  
  42.         WITH ScreenBits.Bounds DO { this is QDGlobals^ s ScreenBits ! }
  43.           SetRect(TheRect, Left, Bottom - 20, Right, Bottom);
  44.         FillRect(TheRect, White);
  45.         MoveTo(TheRect.Left, TheRect.Top);
  46.         LineTo(TheRect.Right, TheRect.Top);
  47.         MoveTo(TheRect.Left + 7, TheRect.Bottom - 7);
  48.         DrawString(Message);
  49.  
  50.         ClosePort(@LocalPort);
  51.         SetPort(SavedPort);
  52.         END;
  53.     END;
  54. END.
  55.